package org.lalib.controller.service;

import java.util.List;

import org.lalib.acquire.IControllerService;
import org.lalib.entity.object.EFood;
import org.lalib.mediator.MFood;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "cFoodService")
public class CFoodService implements IControllerService {

	private static final long serialVersionUID = 1L;

	@Autowired
	private MFood mFood;

	public void update(EFood food) {
		getmFood().update(food);
	}

	public void save(EFood food) {
		getmFood().insert(food);
	}
	
	public void delete(EFood food){
		mFood.remove(food);
	}

	public MFood getmFood() {
		return mFood;
	}

	public void setmFood(MFood mFood) {
		this.mFood = mFood;
	}

	public List<EFood> getAllFoods() {
		return mFood.getAllFoods();
	}

	public List<EFood> getFoodListForGivenName(String name) {
		return mFood.getFoodListForGivenName(name);
	}

	public EFood getFoodById(Long id) {
		return mFood.getEntityById(id);
	}
}